#define BLINKER_WIFI
#define BLINKER_MIOT_LIGHT

#include <Blinker.h>
#include <Wire.h>
#include <Sodaq_SHT2x.h>

char auth[] = "c78bf9020cf2";
char ssid[] = "jiezhuo_phone";
char pswd[] = "12344qwert";
static os_timer_t os_timer;        //计时器
int humi_read, temp_read, isright; //实时温度和湿度
int time_ms;                       //主循环时间基准
bool wsState = false;              //灯是否打开
int light = 0;                     //灯亮度

/**
  * @brief  初始化硬件和软件
  * @param  None
  * @retval None
  */
void setup()
{
    init_hardware();
    init_blink();
    init_moit_light();
}

/**
  * @brief  主循环
  * @param  None
  * @retval None
  */
void loop()
{
    Blinker.run();
    Blinker.delay(1);
    if (time_ms++ >= 300)
    {
        time_ms = 0;
        loop_callback();
    }
}
